<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
$(document).ready(function(){
	$("#select").button({icons:{primary: "ui-icon-gear",secondary: "ui-icon-triangle-1-s"}})
	.toggle(function(){
		$("#website").toggle()//slideDown("slow")
	},
	function(){
		$("#website").toggle()//slideUp("slow");
	})
	//$("#website").mouseout(function(){
	//	$("#website").hide()
	//})
	$("#website li").mouseover(function(){
		$("#website li").removeClass("website_li_selected");
		$(this).addClass("website_li_selected");
	});
	
	$("#website li").click(function(){
		$("#website").hide();//slideUp("slow");
		var wid = $(this).attr("wid");
		if (wid=='') return false;
		$(".list_detail ul").load("index.php?m=column&a=get&ajax=1&wid="+wid,function(){
			bindLink();
		});
		$("#select .ui-button-text").text($(this).text());
		//window.parent.mainFrame.location = 'index.php?m=website&a=attribute&wid='+wid;
	});
});

function bindLink(){
	$(".list_detail ul div").children("a").click(function(){
		$(".list_detail ul div").children("a").css("color","");
		$(this).css("color","red");
	});
	$(".list_detail img").unbind();
	$(".list_detail img").css("cursor","pointer");
	$(".list_detail img").click(function(){
		var src = $(this).attr("src");
		var bclassid = $(this).parent().attr("bclassid");
		var classid = $(this).parent().attr("classid");
		
		$(".list_detail div[bclassid="+classid+"]").toggle();
		$(this).attr("src",getSrc(src));
		
		/*var s = $(this).attr("s");
		var classid = $(this).attr("classid");
		
		if (s == '1'){
			var n = $(".sfold_"+classid).length;
			if (parseInt(n) == '0'){
				$.post('index.php?m=column&a=getsonclass',{'classid':classid},function(data){
					$("#li_"+classid).append(data);
					bindLink();
				});	
			}
		}
		$(".sfold_"+classid).slideToggle();
		return false;
		*/
	});
}
function getSrc(i){
	return i == 'style/images/folder1.gif' ? 'style/images/folder2.gif' : 'style/images/folder1.gif' ;	
}
</script>
<div style="padding-left:2px;" id="buttions">
    <div id="select" style="width:95%">
        请选择站点
    </div>
    
    <div id="website">
        <ul>
            <%foreach item=val from=$websites%>
                <li wid="<%$val.wid%>"><%$val.domain%></li>
            <%/foreach%>
        </ul>
    </div>
    
 </div>
<div id="main_nav" style="padding-top:2px; clear:both">
    <div id="right_main_nav" style="overflow:auto; height:465px;">
        <div class="list_detail" style="padding-top:5px;">
            <ul>
            </ul>
        </div>
    </div>
</div>